package com.ruoyi.basicsys.service.impl;

import java.util.List;

import com.ruoyi.pojo.constant.RConst;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.basicsys.mapper.BasicBuildingMapper;
import com.ruoyi.basicsys.domain.BasicBuilding;
import com.ruoyi.basicsys.service.IBasicBuildingService;

/**
 * 楼栋管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-25
 */
@Service
public class BasicBuildingServiceImpl implements IBasicBuildingService 
{
    @Autowired
    private BasicBuildingMapper basicBuildingMapper;

    /**
     * 查询楼栋管理
     * 
     * @param id 楼栋管理主键
     * @return 楼栋管理
     */
    @Override
    public BasicBuilding selectBasicBuildingById(Long id)
    {
        return basicBuildingMapper.selectBasicBuildingById(id);
    }

    /**
     * 查询楼栋管理列表
     * 
     * @param basicBuilding 楼栋管理
     * @return 楼栋管理
     */
    @Override
    public List<BasicBuilding> selectBasicBuildingList(BasicBuilding basicBuilding)
    {
        return basicBuildingMapper.selectBasicBuildingList(basicBuilding);
    }
    /**
     * 查询所有的楼栋
     * @return
     */
    @Override
    public List<BasicBuilding> selectAllBuilding() {

        return basicBuildingMapper.selectAllBuilding();
    }

    /**
     * 新增楼栋管理
     * 
     * @param basicBuilding 楼栋管理
     * @return 结果
     */
    @Override
    public int insertBasicBuilding(BasicBuilding basicBuilding)
    {
        //状态默认设置为未检测
        basicBuilding.setBuildingStatus(RConst.Num.BASE_LONG_0);
        return basicBuildingMapper.insertBasicBuilding(basicBuilding);
    }

    /**
     * 修改楼栋管理
     * 
     * @param basicBuilding 楼栋管理
     * @return 结果
     */
    @Override
    public int updateBasicBuilding(BasicBuilding basicBuilding)
    {
        return basicBuildingMapper.updateBasicBuilding(basicBuilding);
    }

    /**
     * 批量删除楼栋管理
     * 
     * @param ids 需要删除的楼栋管理主键
     * @return 结果
     */
    @Override
    public int deleteBasicBuildingByIds(Long[] ids)
    {
        return basicBuildingMapper.deleteBasicBuildingByIds(ids);
    }

    /**
     * 删除楼栋管理信息
     * 
     * @param id 楼栋管理主键
     * @return 结果
     */
    @Override
    public int deleteBasicBuildingById(Long id)
    {
        return basicBuildingMapper.deleteBasicBuildingById(id);
    }


}
